package cn.wzy.controller;

import cn.wzy.results.ResponseResult;
import cn.wzy.service.FastDfsService;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@RequestMapping("/fastDfs")
public class FastDfsController {

    @Resource
    public FastDfsService fastDfsService;

    @PostMapping
    public ResponseResult upload(MultipartFile file){
        return fastDfsService.upload(file);
    }

    @DeleteMapping
    public ResponseResult delete(String path){
        return fastDfsService.delete(path);
    }
}
